//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.example.demo.vo.response;

import java.io.Serializable;

public class ResultEntity<T> implements Serializable {
	private static final long serialVersionUID = 1L;
	private String statusCode;
	private String statusMessage;
	private T data;

	public ResultEntity() {
		this.statusCode = ResultEntity.StatusCode.OK.statusCode;
	}
	public ResultEntity(StatusCode statusCode) {
		this.statusCode = statusCode.statusCode;
		this.statusMessage = statusCode.statusMessage;
	}
	public ResultEntity(T data) {
		this.statusCode = ResultEntity.StatusCode.OK.statusCode;
		this.data = data;
	}

	public ResultEntity(String statusCode, T data) {
		this.statusCode = statusCode;
		this.data = data;
	}

	public ResultEntity(String statusCode, String statusMessage) {
		this.statusCode = statusCode;
		this.statusMessage = statusMessage;
	}

	public ResultEntity(String statusCode, String statusMessage, T data) {
		this.statusCode = statusCode;
		this.statusMessage = statusMessage;
		this.data = data;
	}

	public String getStatusCode() {
		return statusCode;
	}

	public void setStatusCode(String statusCode) {
		this.statusCode = statusCode;
	}


	public String getStatusMessage() {
		return statusMessage;
	}
	public void setStatusMessage(String statusMessage) {
		this.statusMessage = statusMessage;
	}
	public T getData() {
		return data;
	}

	public void setData(T data) {
		this.data = data;
	}

	public static enum StatusCode {
		OK("200", "请求成功"), ERROR("400", "请求失败"), UNAUTHORIZED("401", "身份验证失败"), FORBIDDEN("403", "权限不足"), NOT_FOUND(
				"404", "记录不存在"), METHOD_NOT_ALLOWED("405", "目标资源不支持该请求方式"), NOT_ACCEPTABLE("404", "请求格式错误"), GONE("410",
						"请求的资源被永久删除"), UNPROCESSABLE_ENTITY("422", "验证失败"), TOO_MANY_REQUESTS("429",
								"太多的请求"), TRADE_REPETITION("460", "重复交易"), INTERNAL_SERVER_ERROR("500", "请求出错"), EXISTS(
										"601", "记录已经存");

		private final String statusCode;
		private final String statusMessage;

		private StatusCode(String statusCode, String statusMessage) {
			this.statusCode = statusCode;
			this.statusMessage = statusMessage;
		}

		public String getStatusMessage() {
			return this.statusMessage;
		}

		public String getStatusCode() {
			return this.statusCode;
		}
	}
}
